(()=>{
    const webpack_modules = ([
        ,
        ((module) => {
            function demo() {
                console.log("This is the demo of webpack principle !");
                const el = document.createElement("div");
                el.classList.add("container")
                const item = document.createElement("div");
                item.classList.add("item")
                item.innerText = "This is the demo of webpack principle !";
                el.appendChild(item)
                document.body.appendChild(el)
            }
            demo()
            return module.exports = demo
        })
    ])

    /****** webpack module cache ********/
    const webpack_module_cache = {}

    /**
     * implements webpack require function
     * @param moduleId
     * @returns {*}
     */
    function webpack_require(moduleId) {

        const module_cache = webpack_module_cache[moduleId]
        if (module_cache) {
            return module_cache.exports
        }

        const module = webpack_module_cache[moduleId] = {
            exports:{}
        }
        // Execute the module function
        webpack_modules[moduleId](moduleId,module.exports,webpack_require)

        return module.exports
    }

    const webpack_exports = webpack_require(1)
    console.log("webpack_exports:",webpack_exports)
})()
